<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			#div{
				width: 500px;
				height: 400px;
				margin-left: 180px;
				margin-top: -250px;
			
			}
			#a{
				background-color: red;
				width: 150px;
				height: 150px;
			}
			
		</style>
	</head>
	<body>
		<div id="a" onmouseover="over()" onmouseleave="leave()"></div>
		<div id="div" >
			
		</div>
		<script>
			var div=document.getElementById('div');
			function over(){
				div.style.background='gray';
			}
			function leave(){
				setTimeout(time,2000);
			}
			function time(){
			div.style.background='';
			}
		</script>
	</body>
</html>
